/*
 * Copyright (C) 2022 KylinSoft Co., Ltd.
 *
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <https://www.gnu.org/licenses/>.
 */

#ifndef PLATFORMWINDOW_H
#define PLATFORMWINDOW_H

#include <QQuickView>
#include <KWayland/Client/plasmashell.h>

namespace KWayland
{
namespace Client
{
class PlasmaShell;
class Surface;
}
}

class PlatformWindow : public QQuickView
{
    Q_OBJECT
public:
    explicit PlatformWindow(QWindow *parent = nullptr,
                            bool panelTakefocus = false,
                            bool keepAbove = false,
                            KWayland::Client::PlasmaShellSurface::Role surfaceRole = KWayland::Client::PlasmaShellSurface::Role::Normal);

protected:
    void initWindow();

protected:
    bool m_isWayland;

private:
    bool m_panelTakefocus;
    bool m_keepAbove;
    KWayland::Client::PlasmaShellSurface::Role m_waylandSurfaceRole;
    KWayland::Client::PlasmaShellSurface *m_plasmaShellSurface = nullptr;
    KWayland::Client::Surface *m_surface = nullptr;
    KWayland::Client::PlasmaShell *m_plasmaShellInterface = nullptr;
};

#endif // PLATFORMWINDOW_H
